Skip to content

feat: Implement DeviceProvider for IOS-XR#263

Open
sven-rosenzweig wants to merge 2 commits intomainfrom
feat/iosxr_deviceprovider
Open

feat: Implement DeviceProvider for IOS-XR#263
sven-rosenzweig wants to merge 2 commits intomainfrom
feat/iosxr_deviceprovider

Conversation

@sven-rosenzweig
Copy link
Copy Markdown
Contributor

@sven-rosenzweig sven-rosenzweig commented Mar 27, 2026

Implement DeviceProvider for IOS-XR

@sven-rosenzweig sven-rosenzweig force-pushed the feat/iosxr_deviceprovider branch from a56b0db to fd96ddc Compare March 27, 2026 12:46
@sven-rosenzweig
Copy link
Copy Markdown
Contributor Author

merge #145 first. afterwards rebase the changes of this pr

@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label Mar 28, 2026
@hardikdr hardikdr added this to Roadmap Mar 28, 2026
@sven-rosenzweig sven-rosenzweig force-pushed the feat/iosxr_deviceprovider branch from fd96ddc to d7270c4 Compare April 28, 2026 08:56
@sven-rosenzweig sven-rosenzweig force-pushed the feat/iosxr_deviceprovider branch from d7270c4 to 61d298c Compare April 28, 2026 09:42
@github-actions github-actions Bot added size/L and removed size/XL labels Apr 28, 2026
@sven-rosenzweig sven-rosenzweig force-pushed the feat/iosxr_deviceprovider branch from 61d298c to 1031e6e Compare April 28, 2026 09:46
@sven-rosenzweig sven-rosenzweig marked this pull request as ready for review April 28, 2026 09:46
@sven-rosenzweig sven-rosenzweig requested a review from a team as a code owner April 28, 2026 09:46
@github-actions
Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr 41.43% (-7.41%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr/intf.go 57.35% (-5.98%) 68 (+8) 39 (+1) 29 (+7) 👎
github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr/provider.go 33.09% (-7.98%) 139 (+27) 46 93 (+27) 👎
github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr/system.go 66.67% (+66.67%) 3 (+3) 2 (+2) 1 (+1) 🌟

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/ironcore-dev/network-operator/internal/provider/cisco/iosxr/system_test.go

} `json:"interface-configuration"`
}

func (i *Ifaces) XPath() string {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (i *Ifaces) XPath() string {
func (*Ifaces) XPath() string {

func MapInterfaceSpeedToNumeric(speed IFaceSpeed) (int32, error) {
switch speed {
case Speed10G:
return 10000, nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return 10000, nil
return 10_000, nil

nit: you can format numbers like this. Makes it a bit easier to read perhaps.

if err != nil {
return []provider.DevicePort{}, fmt.Errorf("failed to map interface speed to numeric value: %w", err)
}
if s != "" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that ExtractInterfaceSpeedFromName should never return an empty string with a non-nil error. So in theory this check shouldn't be needed.


n, err := MapInterfaceSpeedToNumeric(s)
if err != nil {
return []provider.DevicePort{}, fmt.Errorf("failed to map interface speed to numeric value: %w", err)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return []provider.DevicePort{}, fmt.Errorf("failed to map interface speed to numeric value: %w", err)
return nil, fmt.Errorf("failed to map interface speed to numeric value: %w", err)


const Manufacturer = "Cisco"

// Model is the chassis model of the device, e.g. "NCS-57C3-MOD-SYS".
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments should start with the Name of the type. also applies to the SystemTime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations. size/L

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants